
const fp = require("lodash/fp")

const { Maybe, Container } = require("./3.index.js")
// 实现一个函数ex3, 使用safeProp 和fp.first 找到user 的名字的首字母

let safeProp = fp.curry(function (x, o) {
  return Maybe.of(o[x])
})
let user = {id: 2, name: "Albet"}
const objToName = safeProp("name")

let ex3 = (user) => {
  return fp.first(objToName(user))
}
console.log(ex3(user))